import axios from '@/utils/axios'

export const getCode = (id: string): Promise<ApiResult<SystemCode>> => {
    return axios.get(`system/code/${id}`)
}

export const getCodeListByDictId = (dictId: string): Promise<ApiResult<Array<SystemCode>>> => {
    return axios.get(`system/code/list/${dictId}`)
}

export const postOrPutCode = (data: SystemCode): Promise<ApiResult<null>> => {
    return axios.post(`system/code`, data)
}

export const deleteCode = (id: string): Promise<ApiResult<null>> => {
    return axios.delete(`system/code/${id}`)
}
